home *** CD-ROM | disk | FTP | other *** search
/ Komputer for Alle 2001 #11 / CD 11 (Black) - 2001.iso / Fruity / FRUTFOOT.DXR / 00006_BoxCover.ls < prev    next >
Encoding:
Text File  |  1998-04-13  |  2.5 KB  |  43 lines

  1. property pBoxLocList
  2. global gCurrentTravelProps, gCurrentBoxInfo, gCurrentBoxSprite, gGuyObj, gLeft, gTop, gRight, gBottom
  3.  
  4. on new me
  5.   set pBoxLocList to [1: [#start: point(89, 156), #stretchdirection: 1], 2: [#start: point(179, 156), #stretchdirection: 3], 3: [#start: point(179, 29), #stretchdirection: 1], 4: [#start: point(436, 25), #stretchdirection: 4], 5: [#start: point(438, 178), #stretchdirection: 2], 6: [#start: point(353, 178), #stretchdirection: 3], 7: [#start: point(353, 68), #stretchdirection: 2], 8: [#start: point(246, 68), #stretchdirection: 4], 9: [#start: point(246, 180), #stretchdirection: 2], 10: [#start: point(38, 181), #stretchdirection: 4], 11: [#start: point(36, 289), #stretchdirection: 1], 12: [#start: point(178, 289), #stretchdirection: 3], 13: [#start: point(178, 210), #stretchdirection: 1], 14: [#start: point(327, 212), #stretchdirection: 4], 15: [#start: point(327, 282), #stretchdirection: 1], 16: [#start: point(382, 279), #stretchdirection: 3], 17: [#start: point(385, 201), #stretchdirection: 1]]
  6.   return me
  7. end
  8.  
  9. on mUpdateBoxes me
  10.   if the pPreviousPosInList of gGuyObj < the pPosInTravelList of gGuyObj then
  11.     set gCurrentBoxSprite to 10 + the pPosInTravelList of gGuyObj
  12.     set gCurrentBoxInfo to getAt(pBoxLocList, the pPosInTravelList of gGuyObj)
  13.     case the pPosInTravelList of gGuyObj of
  14.       17:
  15.         set the width of sprite gCurrentBoxSprite to 21
  16.         set the height of sprite gCurrentBoxSprite to 30
  17.       otherwise:
  18.         set the width of sprite gCurrentBoxSprite to 21
  19.         set the height of sprite gCurrentBoxSprite to 21
  20.     end case
  21.     updateStage()
  22.     set the loc of sprite gCurrentBoxSprite to getAt(gCurrentBoxInfo, 1)
  23.     updateStage()
  24.     set the pPreviousPosInList of gGuyObj to the pPosInTravelList of gGuyObj
  25.     set vBoxRect to the rect of sprite gCurrentBoxSprite
  26.     set gLeft to getAt(vBoxRect, 1)
  27.     set gTop to getAt(vBoxRect, 2)
  28.     set gRight to getAt(vBoxRect, 3)
  29.     set gBottom to getAt(vBoxRect, 4)
  30.   end if
  31.   case getAt(gCurrentBoxInfo, 2) of
  32.     1:
  33.       set the rect of sprite gCurrentBoxSprite to rect(gLeft, gTop, the locH of sprite 40 + 5, gBottom)
  34.     2:
  35.       set the rect of sprite gCurrentBoxSprite to rect(the locH of sprite 40 - 10, gTop, gRight, gBottom)
  36.     3:
  37.       set the rect of sprite gCurrentBoxSprite to rect(gLeft, the locV of sprite 40 - 8, gRight, gBottom)
  38.     4:
  39.       set the rect of sprite gCurrentBoxSprite to rect(gLeft, gTop, gRight, the locV of sprite 40 + 5)
  40.   end case
  41.   updateStage()
  42. end
  43.